package com.dfbz.netctoss.mapper;


import com.dfbz.netctoss.entity.Privilege;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@org.apache.ibatis.annotations.Mapper
public interface PrivilegeMapper extends Mapper<Privilege> {

    @Select("select pr.* " +
            "from role_privilege rp, privilege pr " +
            "where pr.privilege_id = rp.privilege_id " +
            "and rp.role_id = #{id}  " +
            "and pr.privilege_id in (1,21,41,61,81,101)")
    List<Privilege> selectByRId(@Param("id") int id);

//    @Select("select pr.* " +
//            "from role_privilege rp, privilege pr " +
//            "where pr.privilege_id = rp.privilege_id " +
//            "and rp.role_id = #{roleId}")
//    List<Privilege> selectAllPrivilegeByRId(@Param("roleId") int roleId);
}